activity selection problem using greedy method